-- GENERATED SPELL FOR [Ethereal Spellfilcher] --


function spell0_16545(pUnit, Event) --@Arcane Volley,Self--
pUnit:FullCastSpellOnTarget(37161,pUnit)
pUnit:RegisterEvent('Sorts_16545', 1000, 1)
end

function spell1_16545(pUnit, Event) --@Spatial Distortion,Self--
pUnit:FullCastSpellOnTarget(30007,pUnit)
pUnit:RegisterEvent('Sorts_16545', 0, 1)
end

function spell2_16545(pUnit, Event) --@Steal Magic,n/a--
pUnit:FullCastSpellOnTarget(30036,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_16545', 0, 1)
end

function spell3_16545(pUnit, Event) --@Transference,n/a--
pUnit:FullCastSpellOnTarget(30039,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_16545', 500, 1)
end

function Sorts_16545(pUnit, Event)
local choix_sorts_16545 = math.random(0, 3)
if choix_sorts_16545 == 0 then
pUnit:RegisterEvent('spell0_16545', 1, 1)
end
if choix_sorts_16545 == 1 then
pUnit:RegisterEvent('spell1_16545', 1, 1)
end
if choix_sorts_16545 == 2 then
pUnit:RegisterEvent('spell2_16545', 1, 1)
end
if choix_sorts_16545 == 3 then
pUnit:RegisterEvent('spell3_16545', 1, 1)
end
end

function mob16545_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_16545', math.random(1500, 3000), 1)
end

function mob16545_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob16545_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob16545_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(16545, 1, 'mob16545_Action')
RegisterUnitEvent(16545, 2, 'mob16545_Leave')
RegisterUnitEvent(16545, 3, 'mob16545_Kill')
RegisterUnitEvent(16545, 4, 'mob16545_Die')
